<?php

/**
 * Loads pages
 *
 * @author iLyas
 */

class Page extends CI_Controller{
    
    public function index(){
        $this->load->model('page_model');
        
        $data['records']= $this->page_model->getUserPageInfo($this->session->userdata('user_id'));
        
        $this->load->view('page', $data);
    }
    
    public function show($id){
        $this->load->model('page_model');
        $this->load->model('user_model');
        
<<<<<<< .mine
        if ($this->page_model->id_page_exists($id)){
            $data['records']= $this->page_model->getPageInfo($id);
            $page_owner = $this->page_model->pageBelongsTo($id);
            $data['user_records'] = $this->user_model->getUserRecords($page_owner);
            $this->load->view('page', $data);        
        }else{
            show_404();
        }
    }
    
    public function show_latest(){
        $this->load->model('page_model');
        
        $data['page_records'] = $this->page_model->get_latest_pages(20);
                
        $this->load->view('pages_listing', $data);
=======
        if ($this->page_model->id_page_exists($id)){
            $data['records']= $this->page_model->getPageInfo($id);
            $page_owner = $this->page_model->pageBelongsTo($id);
            $data['user_records'] = $this->user_model->getUserRecords($page_owner);
            $this->load->view('page', $data);        
        }else{
            show_404('ii');
        }
>>>>>>> .r25
    }
}

?>